﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Utils;

namespace COFE.Core
{
    /// <summary>
    /// Indicated the property is required for an entry to provide basic function.
    /// CacheDirectoryLister (Volume.CachedDirectoryLister) implementation 
    /// must cache these properties when caching an entry.
    /// </summary>
    public class PrimaryPropertyAttribute : Attribute
    {

        
    }


    public static class PrimaryPropertyExtension
    {
        /// <summary>
        /// Whether a property is tagged with PrimaryPropertyAttribute.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="item"></param>
        /// <returns></returns>
        public static bool IsPrimaryProperty<T>(T item)
        {
            return EnumAttributeUtils<PrimaryPropertyAttribute, T>.FindAttribute(item) != null;
        }
    }
}
